<template>
	<div class="app">
		<h2>我是App组件</h2>
		<h3 v-show="ming">School组件给我的学校名称：{{ming}}</h3>
		<h3 v-show="dizhi">School组件给我的学校地址：{{dizhi}}</h3>
		<School @haha="test" @xixi="demo"/>
		<!-- <School @haha="test" @xixi="demo" @click.native="hello"/> -->
	</div>
</template>

<script>
	import School from './components/School'

	export default {
		name:'App',
		components:{School},
		data() {
			return {
				ming:'',
				dizhi:''
			}
		},
		methods: {
			test(value){
				console.log('我给School组件实例对象绑定的haha事件被触发了，并且携带了一个值',value)
				this.ming = value
			},
			demo(value){
				console.log('我给School组件实例对象绑定的xixi事件被触发了，并且携带了一个值',value)
				this.dizhi = value
			},
			hello(){
				alert('hello')
			}
		}
	}
</script>

<style>
	.app{
		background-color: gray;
		padding: 20px;
	}
</style>